package com.platform.cim.service.test.impl;

import com.platform.api.Response;
import com.platform.cim.pojo.sms.SendSmsReq;
import com.platform.cim.pojo.sms.SendSmsResp;
import com.platform.cim.service.test.SendSmsTestInterface;
import com.platform.cim.service.test.client.OutTestFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RestController;

/**
 * 发送短信测试接口实现类
 *
 * @author baohuajie (baohuajie134@163.com)
 * @create 2021 01 01 3:28
 * @since 1.0.0
 */
@Slf4j
@RestController
public class SendSmsTestImpl implements SendSmsTestInterface {

    @Autowired
    private OutTestFeignClient outTestFeignClient;
    @Autowired
    private Environment environment;
    @Value("${test}")
    private String test;

    @Override
    public Response<SendSmsResp> sendSmsTest(SendSmsReq sendSmsReq) {
        log.info("============当前端口号:{}============", environment.getProperty("server.port"));
        Response<SendSmsResp> sendSmsRespResponse = outTestFeignClient.sendSmsTest(sendSmsReq);
        return sendSmsRespResponse;
    }
}
